/*
 * SPI.h
 *
 * Created: 04.10.2012 09:19:05
 *  Author: bardbakk
 */ 

/*!
 * @header		SPI.h
 * @discussion	This file contains all declarations for SPI communication
*/
		
#ifndef SPI_H_
#define SPI_H_

#include <stdio.h>

/*!
 * @function	SPI_init.
 * @discussion	Enables the microcontroller's SPI interface and set it as a master with a clock rate of FCK/16
 * @result		None.
 */	
void SPI_init();


/*!
 * @function	SPI_MasterTransmit.
 * @discussion	Shifts a byte over SPI.
 * @param		cData	The byte to be shifted.
 * @result		None.
 */	
void SPI_MasterTransmit(uint8_t cData);


/*!
 * @function	SPI_MasterReceive.
 * @discussion	Shifts a byte over SPI, thus making the slave shift its register content to us.		 
 * @result		The received byte.
 */	
char SPI_MasterReceive();


#endif /* SPI_H_ */